home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / latexsty1 / EXTENSIONS / sty
Encoding:
Text File  |  1990-05-19  |  25.4 KB  |  612 lines

  1. % Some useful extension macros for LaTex.
  2. %
  3. % --- ------------------------------------------------------------------
  4. % ---       English-style Date Macros for LaTeX, version 1.00--0.
  5. % --- ------------------------------------------------------------------
  6. %
  7. % --- \today (replaces American-style macro of same name)  generates
  8. % ---        today's date in the form 4th October 1066.
  9. % ---        The `th' is raised, reduced in size and underlined in the
  10. % ---        same font style (family) as the rest of the date.
  11. %     \today* generates today's date in brief form 4-Oct-1066.
  12. %
  13. % --- \st    generates a raised, reduced, underlined `st', as in 1st.
  14. % --- \nd    generates a raised, reduced, underlined `nd', as in 2nd.
  15. % --- \rd    generates a raised, reduced, underlined `rd', as in 3rd.
  16. % --- \th    generates a raised, reduced, underlined `th', as in 4th.
  17. %
  18. % --- \dayofweek  generates the day of the week, based on TeX's values
  19. % ---        of \day, \month and \year.
  20. %
  21. % --- Counters.  Note that we use the same registers as TeX holds other
  22. % --- things in (e.g., \count0 holds the page number).  This requires
  23. % --- that \@savestyle, \@setstyle & \dayofweek perform
  24. % --- all their register manipulations within a group.  This may seem
  25. % --- a bit messy, but it saves having registers permanently set
  26. % --- aside just for date calculation.
  27.  
  28. \def\@dow{\count2 }                        % gets day of the week
  29. \def\@leap{\count5 }                       % leap year fingaler
  30. \def\@x{\count6 }                          % temp register
  31. \def\@y{\count7 }                          % another temp register
  32.  
  33.  
  34. % --- A replacement for the ``plain'' TeX and LaTeX \today macro, to
  35. % --- to output the date in English-style.
  36. % --- They ensure the smaller text comes out in the right font by saving
  37. % --- the font family before reducing the size, then restoring it.  (This
  38. % --- was suggested by Leslie Lamport.)  Of course, it requires that the
  39. % --- font in use when today is invoked has a sensible family.
  40.  
  41. \def\@up#1{{\@savestyle\thinspace$^{\underline{\hbox{%
  42.   \scriptsize\@setstyle#1\fam=-1 }}}$}}
  43. \def\st{\@up{st}}
  44. \def\nd{\@up{nd}}
  45. \def\rd{\@up{rd}}
  46. \def\th{\@up{th}}
  47.  
  48. % --- Macros to save and restore the font family.
  49.  
  50. \def\@savestyle{\count0=\the\fam}
  51. \def\@setstyle{\ifcase\count0\rm\or\mit\or\cal\or\rm% what's family 3?
  52.   \or\it\or\sl\or\bf\or\tt\fi}
  53.  
  54. % --- The date, English style (e.g. 4th October 1066) (\today)
  55. %              or brief style (e.g. 4-Oct-1066)       (\today*)
  56.  
  57. \def\today{\@ifstar%
  58.  {\number\day-\ifcase\month\or Jan\or Feb\or Mar \or Apr\or May\or Jun\or
  59.  Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi-\number\year}
  60.  {\number\day\ifcase\day
  61.   \or\st\or\nd\or\rd\or\th\or\th\or\th\or\th\or\th\or\th\or\th
  62.   \or\th\or\th\or\th\or\th\or\th\or\th\or\th\or\th\or\th\or\th
  63.   \or\st\or\nd\or\rd\or\th\or\th\or\th\or\th\or\th\or\th\or\th\or\st\fi
  64.   \space\ifcase\month\or January\or February\or March\or April\or May\or
  65.   June\or July\or August\or September\or October\or November\or December\fi
  66.   \space\number\year}}
  67.  
  68. % --- The day of the week ("Sunday", etc.) is inserted into the text
  69. % --- by \dayofweek. (This uses registers \@dow, \@leap, \@x and \@y.)
  70. % --- I acquired this from elsewhere; I don't know who wrote it.
  71.  
  72. \def\dayofweek{{%
  73. %            leap = year + (month - 14)/12;
  74.   \@leap=\month \advance\@leap by -14 \divide\@leap by 12
  75.   \advance\@leap by \year
  76. %            dow = (13 * (month + 10 - (month + 10)/13*12) - 1)/5
  77.   \@dow=\month \advance\@dow by 10
  78.   \@y=\@dow \divide\@y by 13 \multiply\@y by 12
  79.   \advance\@dow by -\@y \multiply\@dow by 13 \advance\@dow by -1 \divide\@dow by 5
  80. %            dow += day + 77 + 5 * (leap % 100)/4
  81.   \advance\@dow by \day \advance\@dow by 77
  82.   \@x=\@leap \@y=\@x \divide\@y by 100 \multiply\@y by 100 \advance\@x by -\@y
  83.   \multiply\@x by 5 \divide\@x by 4 \advance\@dow by \@x
  84. %            dow += leap / 400
  85.   \@x=\@leap \divide\@x by 400 \advance\@dow by \@x
  86. %            dow -= leap / 100 * 2;
  87. %            dow = (dow % 7)
  88.   \@x=\@leap \divide\@x by 100 \multiply\@x by 2 \advance\@dow by -\@x
  89.   \@x=\@dow \divide\@x by 7 \multiply\@x by 7 \advance\@dow by -\@x
  90.   \ifcase\@dow Sunday\or Monday\or Tuesday\or Wednesday\or
  91.       Thursday\or Friday\or Saturday\fi}}
  92. %
  93. %-------------------------------------------------------------------------
  94. %                          CRL Extensions to LaTeX
  95. %
  96. %\typeout{CRDS Extensions to LaTeX,  V1.1.  (RL Aurbach, 09-Sep-1986)}
  97. %
  98. %****************************************************************************
  99. %*                                                                          *
  100. %*                Outline Environment                    *
  101. %*                                        *
  102. %* Description:                                    *
  103. %*    The outline environment is a modified enumerate environment in        *
  104. %*    which the numbering is done using standard outlining conventions.   *
  105. %*                                        *
  106. %* Syntax:                                                                  *
  107. %*    \begin{outline}        \item text    \end{outline}                *
  108. %*                                        *
  109. %****************************************************************************
  110. %
  111. \@definecounter{outlni} \@definecounter{outlnii} \@definecounter{outlniii}
  112. \@definecounter{outlniv} \@definecounter{outlnv}
  113. \newcount\@outlndepth  \@outlndepth =0
  114.  
  115. \def\outline{\ifnum \@outlndepth >4 \@toodeep \else \advance\@outlndepth\@ne
  116.   \edef\@outlnctr{outln\romannumeral\the\@outlndepth}\list
  117.   {\csname label\@outlnctr\endcsname}{\usecounter{\@outlnctr}
  118.   \def\makelabel##1{\hss\llap{##1}}}\fi}
  119. \let\endoutline =\endlist
  120.  
  121. \def\labeloutlni{\Roman{outlni}.}       \def\theoutlni{\Roman{outlni}}
  122. \def\labeloutlnii{\Alph{outlnii}.}      \def\theoutlnii{\Alph{outlnii}}
  123. \def\labeloutlniii{\arabic{outlniii}.}  \def\theoutlniii{\arabic{outlniii}}
  124. \def\labeloutlniv{\alph{outlniv}.}      \def\theoutlniv{\alph{outlniv}}
  125. \def\labeloutlnv{(\roman{outlnv})}      \def\theoutlnv{\roman{outlnv}}
  126. \def\p@outlnii{\theoutlni.}             \def\p@outlniii{\p@outlnii\theoutlnii.}
  127. \def\p@outlniv{\p@outlniii\theoutlniii.}\def\p@outlnv{\p@outlniv\theoutlniv.}
  128.  
  129. %
  130. %****************************************************************************
  131. %*                                                                          *
  132. %*                InfoMap Environment                    *
  133. %*                                        *
  134. %* Description:                                    *
  135. %*    The infomap environment is a modified description environment in    *
  136. %*    which the label is set off from the text as a signpost.  The        *
  137. %*    signpost is implemented in a \parbox to allow for a multi-line        *
  138. %*    label.                                    *
  139. %*                                        *
  140. %* Syntax:                                                                  *
  141. %*    \begin{infomap}  \item[label] text  \end{infomap}            *
  142. %*                                        *
  143. %* Where:                                    *
  144. %*    label    is the text to be placed in the Signpost at the current        *
  145. %*        left margin.                            *
  146. %*                                        *
  147. %* Note:                                    *
  148. %*    The signpost is implemented as a \parbox set in a \raisebox which   *
  149. %*    has a depth of 0pt.  This is necessary to make a multi-line sign-   *
  150. %*    work correctly, but occasionally, you will need to add extra        *
  151. %*    vertical space if the signpost occupies more lines than the text.   *
  152. %*                                        *
  153. %****************************************************************************
  154. %
  155. \newdimen\infomapmargin
  156. \newdimen\infomapwidth
  157.  
  158. \infomapmargin 115pt
  159. \infomapwidth 103pt
  160. \def\infomaplabel#1{\raisebox{0pt}[1em][0pt]{\makebox[\labelwidth][l]
  161.     {\parbox[t]{\infomapwidth}{\bf #1}}}}
  162. \def\infomap{\list{}{\leftmargin\infomapmargin
  163.     \labelwidth\leftmargin\advance\labelwidth-\labelsep
  164.     \let\makelabel\infomaplabel}}
  165. \let\endinfomap\endlist
  166. \def\ttitem[#1]{\item[{\tt #1}]}
  167.  
  168. %
  169. %****************************************************************************
  170. %*                                                                          *
  171. %*                Note Environment                    *
  172. %*                                        *
  173. %* Description:                                    *
  174. %*    The note environment is a modified version of the quote environment.*
  175. %*    It is distinctive in that it has a centered title for the note        *
  176. %*    prior to the beginning of the text.  The title may be specified,    *
  177. %*    using the optional argument.  If no title is specified, the title   *
  178. %*    "Note" is used.                                *
  179. %*                                        *
  180. %* Syntax:                                                                  *
  181. %*    \begin{note}[title]  text  \end{note}                    *
  182. %*                                        *
  183. %* Where:                                    *
  184. %*    title        is the text to be used as the title.  If not specified  *
  185. %*            "Note" is used.  The title is centered above the text,  *
  186. %*            in boldface.                        *
  187. %*                                        *
  188. %* Note:                                    *
  189. %*    It is possible for the title and text of a note to be separated        *
  190. %*    across a page break.  So far, I haven't been able to discover a        *
  191. %*    fool-proof way to prevent this from occurring, so check the output. *
  192. %*                                        *
  193. %****************************************************************************
  194. %
  195. \def\note{\@ifnextchar [{\@note}{\@note[Note]}}
  196. \def\@note[#1]{\par \list{}{\leftmargin 2em \rightmargin\leftmargin }
  197.     \item[] \hfil {\bf #1} \hfil \par \item[]}
  198. \let\endnote\endlist
  199.  
  200. %
  201. %****************************************************************************
  202. %*                                                                          *
  203. %*                Ctl Command                        *
  204. %*                                        *
  205. %* Description:                                    *
  206. %*    The \ctl command is used to place a representation of a control        *
  207. %*    character in the document.  \ctl{x} is represented as ^x.        *
  208. %*                                        *
  209. %* Syntax:                                                                  *
  210. %*    \ctl{ch}                                *
  211. %*                                        *
  212. %* Where:                                    *
  213. %*    ch    is the character to be represented.                *
  214. %*                                        *
  215. %* Note:                                    *
  216. %*    The character is displayed in \tt.                    *
  217. %*                                        *
  218. %****************************************************************************
  219. %
  220. \def\ctl#1{{\tt $^\wedge$#1}}
  221.  
  222. %
  223. %****************************************************************************
  224. %*                                                                          *
  225. %*                Trademark Command                    *
  226. %*                                        *
  227. %* Description:                                    *
  228. %*    This command generates a trademark symbol (an R in a circle).  The  *
  229. %*    symbol is normally used as "foo$^\trademark$".                *
  230. %*                                        *
  231. %* Syntax:                                                                  *
  232. %*    \trademark                                *
  233. %*                                        *
  234. %* Note:                                    *
  235. %*    Thanks to Kent McPherson of Lear/Siegler for this command.        *
  236. %*                                        *
  237. %****************************************************************************
  238. %
  239. \def\trademark{{\ooalign
  240.    {\tiny \hfill \raise .085ex\hbox{R}\hfill \crcr
  241.     \scriptsize \mathhexbox20D}}}
  242.  
  243. %
  244. %****************************************************************************
  245. %*                                                                          *
  246. %*                ULine Command                    *
  247. %*                                        *
  248. %* Description:                                    *
  249. %*    The \uline command is used to underline text.  Unlike the        *
  250. %*    \underline command, \uline provides the user with the ability to    *
  251. %*    control the thickness of the line.                    *
  252. %*                                        *
  253. %* Syntax:                                                                  *
  254. %*    \uline{text}{thickness}                            *
  255. %*                                        *
  256. %* Where:                                    *
  257. %*    text        is the text which will be underlined.            *
  258. %*                                        *
  259. %*    thickness   is the thickness of the line.  This dimension is        *
  260. %*            typically .3pt --.5pt.                    *
  261. %*                                        *
  262. %* Note:                                    *
  263. %*    Thanks to Kent McPherson of Lear/Siegler for this command.        *
  264. %*                                        *
  265. %****************************************************************************
  266. %
  267. \newlength{\ulength}
  268. \newcommand{\uline}[2]{\settowidth{\ulength}{#1}
  269.     \parbox{\ulength}{{#1} \\[-.75\baselineskip] \rule{\ulength}{#2}}}
  270.  
  271. %
  272. %****************************************************************************
  273. %*                                                                          *
  274. %*                ClearDoublePage Command                *
  275. %*                                        *
  276. %* Description:                                    *
  277. %*    This command is a modification of the standard LaTeX command of the *
  278. %*    same name.  Unlike standard LaTeX, this command uses the "empty"    *
  279. %*    pagestyle for the blank page it throws, so that the page is totally *
  280. %*    blank.                                    *
  281. %*                                        *
  282. %* Syntax:                                                                  *
  283. %*    \cleardoublepage                            *
  284. %*                                        *
  285. %****************************************************************************
  286. %
  287. \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  288.   \if@twocolumn\hbox{}\newpage\fi\hbox{}\thispagestyle{empty}\newpage\fi\fi}
  289.  
  290. %
  291. %****************************************************************************
  292. %*                                                                          *
  293. %*            ForceRightPage Command                    *
  294. %*                                        *
  295. %* Description:                                    *
  296. %*    The \forcerightpage command is a variant on the \cleardoublepage    *
  297. %*    command.  It conditionally throws a blank page to force the text    *
  298. %*    which follows to appear on a right-hand page.  The blank page will  *
  299. %*    contain an optional, centered message.                    *
  300. %*                                        *
  301. %* Syntax:                                                                  *
  302. %*    \forcerightpage[text]                            *
  303. %*                                        *
  304. %* Where:                                    *
  305. %*    text        is the text to be displayed centered on the page.  If   *
  306. %*            not specified, "This page intentionally left blank"   *
  307. %*            is used.                            *
  308. %*                                        *
  309. %* Note:                                    *
  310. %*    This command will not correctly handle a two-column document and    *
  311. %*    should not be used in that environment.                    *
  312. %*                                        *
  313. %****************************************************************************
  314. %
  315. \def\forcerightpage{\@ifnextchar [{\@forcerightpage}
  316.     {\@forcerightpage[This page intentionally left blank]}}
  317. \def\@forcerightpage[#1]{\clearpage\if@twoside \ifodd\c@page\else
  318.     \hbox{} \vfill \centerline{#1} \vfill \newpage\fi\fi}
  319.  
  320. %
  321. %****************************************************************************
  322. %*                                        *
  323. %*            ForceLeftPage Command                    *
  324. %*                                                                          *
  325. %* Description:                                    *
  326. %*    The \forceleftpage command is a variant on the \cleardoublepage        *
  327. %*    command.  It conditionally throws a blank page to force the text    *
  328. %*    which follows to appear on a left-hand page.  The blank page will   *
  329. %*    contain an optional, centered message.                    *
  330. %*                                        *
  331. %* Syntax:                                                                  *
  332. %*    \forceleftpage[text]                            *
  333. %*                                        *
  334. %* Where:                                    *
  335. %*    text        is the text to be displayed centered on the page.  If   *
  336. %*            not specified, "This page intentionally left blank"   *
  337. %*            is used.                            *
  338. %*                                        *
  339. %* Note:                                    *
  340. %*    This command will not correctly handle a two-column document and    *
  341. %*    should not be used in that environment.                    *
  342. %*                                        *
  343. %****************************************************************************
  344. %
  345. \def\forceleftpage{\@ifnextchar [{\@forceleftpage}
  346.     {\@forceleftpage[This page intentionally left blank]}}
  347. \def\@forceleftpage[#1]{\clearpage \if@twoside \ifodd\c@page 
  348.     \hbox{} \vfill \centerline{#1} \vfill \newpage\fi\fi}
  349.  
  350. %
  351. %****************************************************************************
  352. %*                                        *
  353. %*            Input Command                        *
  354. %*                                                                          *
  355. %* Description:                                    *
  356. %*    The \input command is a variation of the standard LaTeX command of  *
  357. %*    the same name.  It reads in an external file.  It differs from the  *
  358. %*    normal LaTeX command in that if the specified file is not found,    *
  359. %*    the routine displays a message and continues, rather than prompting *
  360. %*    for a new file name.                            *
  361. %*                                        *
  362. %* Syntax:                                                                  *
  363. %*    \input{file}                                *
  364. %*                                        *
  365. %* Where:                                    *
  366. %*    file        is the file specification of the input file to be read. *
  367. %*            By default, the file has the file type ".tex" unless    *
  368. %*            specified otherwise.  If the file is not found in the   *
  369. %*            current default directory, it will be searched for in   *
  370. %*            TEX$INPUTS.                            *
  371. %*                                        *
  372. %****************************************************************************
  373. %
  374. \def\input{\@ifnextchar \bgroup{\@input}{\@@input }}
  375.  
  376. %
  377. %****************************************************************************
  378. %*                                        *
  379. %*            CoverStyle Command                    *
  380. %*                                                                          *
  381. %* Description:                                    *
  382. %*    This routine defines a cover style for a document.  It reads in a   *
  383. %*    ".cvrsty" file, which contains the necessary information.        *
  384. %*                                        *
  385. %* Syntax:                                                                  *
  386. %*    \coverstyle{name}                            *
  387. %*                                        *
  388. %* Where:                                    *
  389. %*    name        is the name of a coverstyle.  The file name.cvrsty will *
  390. %*            be input.                            *
  391. %*                                        *
  392. %****************************************************************************
  393. %
  394. \def\coverstyle#1{\def\@coverstyle{#1} 
  395.   \makeatletter \input \@coverstyle.cvrsty \relax \makeatother}
  396.  
  397. %
  398. %****************************************************************************
  399. %*                                        *
  400. %*            ScreenPix Environment                    *
  401. %*                                                                          *
  402. %* Description:                                    *
  403. %*    The screenpix environment is used to display the image of a screen  *
  404. %*    in a document.  A curved line is drawn at the top, which represents *
  405. %*    the beginning of the screen.  After the verbatim text, another line *
  406. %*    is drawn at the bottom to represent the bottom of the screen.        *
  407. %*                                        *
  408. %*    Lines up to 80 characters long may appear.  You should place a        *
  409. %*    leading space at the beginning of each line, so that the text will  *
  410. %*    not overwrite the curved lines.  Since tabs are not expanded in        *
  411. %*    verbatim mode, they should be explicitly converted to spaces.        *
  412. %*                                        *
  413. %* Syntax:                                                                  *
  414. %*    \begin{screenpix}                            *
  415. %*    \begin{verbatim}                            *
  416. %*     lines of verbatim screen-image text                    *
  417. %*    \end{verbatim}                                *
  418. %*    \end{screenpix}                                *
  419. %*                                        *
  420. %* Where:                                    *
  421. %*    The lines of verbatim text may be up to 80 characters long, not        *
  422. %*    counting the REQUIRED leading space on each line.            *
  423. %*                                        *
  424. %* Note:                                    *
  425. %*    This environment assumes that a text width of 6 inches is available *
  426. %*    for the display of the screen.                        *
  427. %*                                        *
  428. %****************************************************************************
  429. %
  430. \def\screenpix{\small \setlength{\unitlength}{1in} \thicklines
  431.     \begin{picture}(6,.35) \put(3,0){\oval(6,.7)[t]} \end{picture}\par
  432.     \vspace*{-3\parskip}}
  433. \def\endscreenpix{\vspace*{-3\parskip}
  434.     \begin{picture}(6,.35) \put(3,.35){\oval(6,.7)[b]} \end{picture}}
  435.  
  436. %
  437. %****************************************************************************
  438. %*                                        *
  439. %*                Glossaryfile Command                *
  440. %*                                                                          *
  441. %* Description:                                    *
  442. %*    This command is used to specify one or more Glossary Definition        *
  443. %*    files which will be searched for glossary definitions by GloTeX.    *
  444. %*                                        *
  445. %* Syntax:                                                                  *
  446. %*    \glossaryfile{filelist}                            *
  447. %*                                        *
  448. %* Where:                                    *
  449. %*    filelist    is a file specification of a .gdf file or a comma-list  *
  450. %*            of file specifications.                    *
  451. %*                                        *
  452. %* Note:                                    *
  453. %*    This command writes a \glofile command to the .glo file            *
  454. %*                                        *
  455. %****************************************************************************
  456. %
  457. \def\glossaryfile#1{\if@filesw\write\@glossaryfile{\string
  458.     \glofile{#1}}\fi}
  459.  
  460. %
  461. %****************************************************************************
  462. %*                                        *
  463. %*                InsertGlossary Command                *
  464. %*                                                                          *
  465. %* Description:                                    *
  466. %*    This command causes a .gls file to be read in and processed.        *
  467. %*                                        *
  468. %* Syntax:                                                                  *
  469. %*    \insertglossary                                *
  470. %*                                        *
  471. %* Note:                                    *
  472. %*    The .gls file is assumed to have the same name as the root latex    *
  473. %*    source file.                                *
  474. %*                                        *
  475. %****************************************************************************
  476. %
  477. \def\insertglossary{\@input{\jobname.gls}}
  478.  
  479. %
  480. %****************************************************************************
  481. %*                                        *
  482. %*                InsertIndex Command                    *
  483. %*                                                                          *
  484. %* Description:                                    *
  485. %*    This command causes an .ind file to be read in and processed.        *
  486. %*                                        *
  487. %* Syntax:                                                                  *
  488. %*    \insertindex                                *
  489. %*                                        *
  490. %* Note:                                    *
  491. %*    The .ind file is assumed to have the same name as the root latex    *
  492. %*    source file.                                *
  493. %*                                        *
  494. %****************************************************************************
  495. %
  496. \def\insertindex{\@input{\jobname.ind}}
  497. %
  498. %===========================================================================
  499. % RMCS MACROS
  500. %===========================================================================
  501. %
  502. %---------------------------------------------------------------------------
  503. %   Ensure that the next page of text is on a recto page (i.e. an odd
  504. %   numbered page). If the next page number is even, output a page with no
  505. %   headings informing the reader that it is intentionally blank.
  506. %   Originally intended to be used at the end of chapters in report style.
  507. %---------------------------------------------------------------------------
  508. \newcommand{\chapend}{\clearpage\ifodd\count0\else
  509.   \markboth{}{}
  510.   \vspace*{\fill}\centerline{\small This page is left intentionally blank}
  511.   \vspace*{\fill}\cleardoublepage\fi}
  512. %
  513. %---------------------------------------------------------------------------
  514. %   Allow the listing of programs in \tt font, with an approximation for
  515. %   any embedded tabs.
  516. %---------------------------------------------------------------------------
  517. {\catcode`\^^I=\active
  518.   \gdef\obeytabs{\catcode`\^^I=\active\let^^I=\quad}
  519.   \global\let^^I\quad}
  520. \def\program{\begingroup\tt\obeylines\obeytabs}%
  521. \def\endprogram{\endgroup}
  522. %
  523. %---------------------------------------------------------------------------
  524. %   Allow the selection of some or all modules of a large LaTeX document.
  525. %   Very useful for PhD writers!
  526. %---------------------------------------------------------------------------
  527. \newcommand{\select}[1]
  528.     {
  529.     \typeout{  }
  530.     \typeout{Files which may be included in this document are ... }
  531.     \typeout{  }
  532.     \typeout{\space\space\space\space#1}
  533.     \typeout{  }
  534.     \typeout{To include one file, type its name.}
  535.     \typeout{To include some files, type the names separated by commas
  536.     and NO spaces.}
  537.     \typeout{To include all of the files, just hit RETURN.}
  538.     \typeout{ }
  539.     \typein[\inclusions]{Enter the files to be included: }
  540.     \if\inclusions
  541.     \endlinechar\relax
  542.     \else
  543.     \includeonly{\inclusions}
  544.     \fi
  545.     }
  546. %
  547. %--------------------------------------------------------------------------
  548. % Adapted from Aston University: FORTRAN.TEX
  549. %
  550. % This is a file of commands for printing out programs using TeX 
  551. %                               -- see DIRTY TRICKS in TeXbook
  552. %
  553. %       This version is designed to print source code at 9 point
  554. %       fitting an 80 column line into a 6 true inch width with 
  555. %       8 point line numbers before each line, except for \listing*
  556. %    which doesn't have line numbers.
  557. %       It handles TAB (^I) characters almost the same as DEC
  558. %       
  559. %    \listing{file.ext}      % use dev:[dir] if you wish
  560. %    \listing*{file.ext}     % use dev:[dir] if you wish
  561. %
  562. %       B.H. Toby  8/86
  563. %    C.N. Kempson 22-NOV-1988
  564. %
  565. \newcount\lineno
  566. \font\Alisttt=cmtt9 at 9 truept
  567. \font\Alistrm=cmr8 at 8 truept
  568. \def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
  569.  
  570. \def\listing{\@ifstar{\@listingnolinenos}{\@listingwithlinenos}}
  571. \def\@listingnolinenos#1{%
  572.     \def\everyparaction{\llap{\ }\startbox}
  573.     \par\begingroup\setupverbatim\input#1 \endgroup}
  574. \def\@listingwithlinenos#1{%
  575.     \def\everyparaction{\advance\lineno by1 %
  576.     \llap{\Alistrm\the\lineno\ \ }\startbox}
  577.     \par\begingroup\setupverbatim\input#1 \endgroup}
  578.  
  579. \def\setupverbatim{
  580.   \Alisttt\baselineskip= 8.5truept\lineskip=1truept
  581.   \lineskiplimit=1truept\topskip=0pt
  582.   \lineno=0
  583.   \def\par{\leavevmode\egroup\box0\endgraf} 
  584.   \obeylines \uncatcodespecials \obeyspaces
  585.   \catcode`\`=\active \catcode`\^^I=\active
  586.   \everypar{\everyparaction}
  587.   }
  588. \newdimen\w \setbox0=\hbox{\Alisttt\space} \w=8\wd0
  589. \def\startbox{\setbox0=\hbox\bgroup}
  590. {\catcode`\^^I=\active 
  591.   \gdef^^I{\leavevmode\egroup
  592.     \dimen0=\wd0
  593.     \divide\dimen0 by\w
  594.     \multiply\dimen0 by\w
  595.     \advance\dimen0 by\w
  596.     \wd0=\dimen0 \box0 \startbox}}
  597. {\obeyspaces\global\let =\ }
  598. {\catcode`\`=\active \gdef`{\relax\lq}}
  599. %
  600. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  601. %
  602. %               Met. Office (HERMES - D.Offiler) extensions...
  603. %
  604. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  605. %
  606. \newcommand{\HERMES}{\mbox{\sl HERMES}}
  607. \newcommand{\ZEPHYR}{\mbox{$\cal ZEPHYR$}}
  608. \newcommand{\crest}{\special{ln03:plotfile tex$inputs:mocrest.sxl}}
  609. \newcommand{\smallcrest}{\special{ln03:plotfile tex$inputs:small_mocrest.sxl}}
  610.  
  611. \arrayrulewidth 0.8pt    % beef up the line widths in tabular & array envs.
  612.